/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jsrpc.bridge;

import java.util.List;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

/**
 *
 * @author neo
 */
public class RegisterTagHandler extends TagSupport {
    private static final long serialVersionUID = 1804955888850555324L;
    private String id;
    private String bean;

    @Override
    public int doStartTag() throws JspException {
        String pageId = (String)pageContext.getAttribute(Key.PAGE_ID);
        List<Broker> list = (List<Broker>)pageContext.getSession().getAttribute(Key.REMOTE_REGISTER+"."+pageId);
        list.add(new Broker(id, bean));
        System.out.println("id:"+ id +" bean:"+ bean);
        //session.setAttribute(Key.REMOTE_REGISTER, list);
        return super.doStartTag();
    }

    @Override
    public int doEndTag() throws JspException {
        return super.doEndTag();
    }

    

    public void setId(String id) {
        this.id = id;
    }

    public void setBean(String bean) {
        this.bean = bean;
    }

}
